package com.yzh.controller;

import com.yzh.domain.ClassRoom;
import com.yzh.service.ClassRoomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@Api(tags = "显示全部用户的接口")
@RequestMapping("/classroom")
public class ClassRoomController {

    private ClassRoomService classRoomService;
    @Autowired
    public void setClassRoomService(ClassRoomService classRoomService) {
        this.classRoomService = classRoomService;
    }

    @RequestMapping("/clist")
    @ApiOperation("显示全部人员信息")
    public String getAllCR(Model model){
        List<ClassRoom> classRoomList=classRoomService.getAllCR();
        model.addAttribute("clist",classRoomList);

        return "student/Clist";
    }
}
